package cn.xxm.strategy.pay.service.impl;


import cn.xxm.strategy.pay.base.BaseResponse;
import cn.xxm.strategy.pay.context.SourceHandlerContext;
import cn.xxm.strategy.pay.dto.SourceIntergateInfoDTO;
import cn.xxm.strategy.pay.handler.PaySourceHandler;
import cn.xxm.strategy.pay.service.SourceIntergateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class SourceIntergateServiceImpl implements SourceIntergateService {

	@Autowired
	private SourceHandlerContext sourceHandlerContext;

	@Override
	public BaseResponse<Object> pay(SourceIntergateInfoDTO sourceChanelInfoDTO) {
        PaySourceHandler sourcehandler = sourceHandlerContext.getInstance(sourceChanelInfoDTO.getSource());
		return sourcehandler.handle(sourceChanelInfoDTO);
	}
	
	
	
}
